package com.borko.healthcare.persistence.hibernate.services;

import java.util.List;

import com.borko.healthcare.entities.interfaces.Medicine;
import com.borko.healthcare.persistence.hibernate.dao.MedicineDAO;

public class MedicineManagerImpl implements MedicineManager {
	
	private MedicineDAO medicineDAO;

	public MedicineDAO getMedicineDAO() {
		return this.medicineDAO;
	}

	public void setMedicineDAO(MedicineDAO medicineDAO) {
		this.medicineDAO = medicineDAO;
	}

	public void add(Medicine medicine) {
		medicineDAO.create(medicine);
	}

	public void applyChanges(Medicine medicine) {
		medicineDAO.update(medicine);
	}

	public List<Medicine> list() {
		return medicineDAO.retrive();
	}

	public void remove(Medicine medicine) {
		medicineDAO.delete(medicine);
	}

	public Medicine getMedicine(int id) {
		return medicineDAO.getMedicine(id);
	}

}
